# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pyvirtualdisplay
pkgname=('python2-pyvirtualdisplay' 'python-pyvirtualdisplay')
_pkgname=PyVirtualDisplay
pkgver=3.0
pkgrel=4
pkgdesc='Python wrapper for Xvfb, Xephyr and Xvnc.'
arch=('any')
url='https://pypi.org/project/pyvirtualdisplay/#files'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/PyVirtualDisplay-$pkgver.tar.gz")
sha512sums=('0fa5c606e01bfa3a84b064a8b93b0f446418622c267a1c85618625864a6523e34adb04e3bff44b388617cb11355f24636c5e39bb5c12fd4944ef46947b5f58f9')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-pyvirtualdisplay() {
  depends=('python2' 'python2-easyprocess')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-pyvirtualdisplay() {
  depends=('python' 'python-easyprocess')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

